package com.cyanite.playlv2api.types;

import com.cyanite.playlv2api.util.ParcelUtils;

import android.os.Parcel;
import android.os.Parcelable;

public class TaskMini implements PlayLv2Type, Parcelable {

    private String mId;
    private int  mType;
    private Info mInfo;
    
    public TaskMini(){
        
    }
    
    private TaskMini(Parcel in) {
        mId = ParcelUtils.readStringFromParcel(in);
        mType = Integer.valueOf(ParcelUtils.readStringFromParcel(in));
        if (in.readInt() == 1) {
            mInfo = in.readParcelable(Info.class.getClassLoader());
        }
    }
    
    public static final Parcelable.Creator<TaskMini> CREATOR = new Parcelable.Creator<TaskMini>() {
        public TaskMini createFromParcel(Parcel in) {
            return new TaskMini(in);
        }

        @Override
        public TaskMini[] newArray(int size) {
            return new TaskMini[size];
        }
    };
    
    @Override
    public void writeToParcel(Parcel out, int flags) {
        ParcelUtils.writeStringToParcel(out, mId);
        ParcelUtils.writeStringToParcel(out, String.valueOf(mType));
        if (mInfo != null) {
            out.writeInt(1);
            out.writeParcelable(mInfo, flags);
        } else {
            out.writeInt(0);
        }
    }
    
    public void setId(String id)   {
        mId = id;
    }

    public String getId()  {
        return mId;
    }

    public void setType(int type)   {
        mType = type;
    }

    public int getType(){
        return mType;
    }

    public void setInfo(Info info)    {
        mInfo = info;
    }

    public Info getInfo() {
        return mInfo;
    }

    @Override
    public int describeContents() {
        return 0;
    }   
}
